package com.aaa.mrcai.controller;

import com.aaa.mrcai.annotion.AAALog;
import com.aaa.mrcai.result.AjaxResult;
import com.aaa.mrcai.service.UserLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * Demo class
 *
 * @Author: Wang
 * @Date: Created in 15:04 2021/12/8
 */
@Controller
@RequestMapping("consumer")
public class UserLoginController {
    @Autowired
    private UserLoginService userLoginService;

    @RequestMapping("record")
    @ResponseBody
    public AjaxResult userLogin(String telephone, String password){
        return userLoginService.userLogin(telephone,password);
    }

    @RequestMapping("getInfo")
    @ResponseBody
    public AjaxResult getInfo(){
        return userLoginService.getInfo();
    }

    @RequestMapping("businessLogin")
    @ResponseBody
    public AjaxResult businessLogin(){
        return userLoginService.businessLogin();
    }

    @RequestMapping("logout")
    public String logout(){
        userLoginService.logout();
        return "redirect:/index.html";
    }

    @RequestMapping("back")
    public String back(){
        userLoginService.logout();
        return "redirect:/userLogin.html";
    }

    @RequestMapping("getBid")
    @ResponseBody
    public AjaxResult getBid(){
        return userLoginService.getBid();
    }

    @RequestMapping("getUid")
    @ResponseBody
    public AjaxResult getUid(){
        return userLoginService.getUid();
    }
}
